package com.flurry.android;

import android.util.Base64;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.http.NameValuePair;
import org.json.JSONObject;

public class FlurryAppCloudRequestManager
{
  public static String UserSession = "";
  private static String dR = "";
  private static String dS = "{code: \"400\", note: \"Please use FlurryAppCloud.saveOrCreateUser() for updating users.\"}";
  private static String dT = "{code: \"400\", note: \"Please use FlurryAppCloud.saveOrCreateUser() for creating users.\"}";
  private static String dU = "{code: \"400\", note: \"Please use FlurryAppCloud.deleteUser() for deleting users.\"}";
  private static String dV = "del_internal";
  public static boolean fInternalApi = false;

  public static void Delete(String paramString, AppCloudResponseHandler paramAppCloudResponseHandler)
    throws Exception
  {
    HashMap localHashMap = new HashMap();
    a(localHashMap);
    ek localek = new ek();
    localHashMap.put(dV, localek);
    localHashMap.put("del", paramAppCloudResponseHandler);
    localHashMap.put("url", paramString);
    if ((paramString.startsWith("v1/user")) && (!fInternalApi))
    {
      paramAppCloudResponseHandler.handleResponse(new AppCloudResponse(new JSONObject(dU)));
      return;
    }
    new fb().execute(new HashMap[] { localHashMap });
    fInternalApi = false;
  }

  public static void Get(String paramString, List<NameValuePair> paramList, AppCloudResponseHandler paramAppCloudResponseHandler)
    throws Exception
  {
    HashMap localHashMap = new HashMap();
    a(localHashMap);
    ej localej = new ej();
    localHashMap.put(dV, localej);
    localHashMap.put("del", paramAppCloudResponseHandler);
    if (paramList != null)
      localHashMap.put("url", paramString + "/" + ec.g(paramList));
    while (true)
    {
      new fw().execute(new HashMap[] { localHashMap });
      return;
      localHashMap.put("url", paramString + "/");
    }
  }

  public static void Post(String paramString, List<NameValuePair> paramList, AppCloudResponseHandler paramAppCloudResponseHandler)
    throws Exception
  {
    HashMap localHashMap = new HashMap();
    a(localHashMap);
    eh localeh = new eh();
    localHashMap.put(dV, localeh);
    localHashMap.put("del", paramAppCloudResponseHandler);
    localHashMap.put("url", paramString);
    localHashMap.put("data", paramList);
    if ((paramString.startsWith("v1/user")) && (!fInternalApi))
    {
      paramAppCloudResponseHandler.handleResponse(new AppCloudResponse(new JSONObject(dT)));
      return;
    }
    new ap().execute(new HashMap[] { localHashMap });
    fInternalApi = false;
  }

  public static void Put(String paramString, List<NameValuePair> paramList, AppCloudResponseHandler paramAppCloudResponseHandler)
    throws Exception
  {
    HashMap localHashMap = new HashMap();
    a(localHashMap);
    ei localei = new ei();
    localHashMap.put(dV, localei);
    localHashMap.put("del", paramAppCloudResponseHandler);
    localHashMap.put("url", paramString);
    if (paramList == null)
      localHashMap.put("data", new ArrayList());
    while ((paramString.startsWith("v1/user")) && (!fInternalApi))
    {
      paramAppCloudResponseHandler.handleResponse(new AppCloudResponse(new JSONObject(dS)));
      return;
      localHashMap.put("data", paramList);
    }
    new bt().execute(new HashMap[] { localHashMap });
    fInternalApi = false;
  }

  private static void a(HashMap<String, Object> paramHashMap)
  {
    paramHashMap.put("session", UserSession);
    paramHashMap.put("auth", dR);
  }

  static void g(String paramString)
  {
    String str = paramString + ":" + paramString;
    dR = "Basic " + Base64.encodeToString(str.getBytes(), 10);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.FlurryAppCloudRequestManager
 * JD-Core Version:    0.6.2
 */